<template>
	<view class="commission-item">
		<view class="flex flex-align-center flex-space-between font32  f-b">
			<text class="color-181D18">{{ dataItem.remark }}</text>
			<text class="color-F52200">+{{ dataItem.commission_account }}</text>
		</view>
		<view class="m-t-20 color-8E8E8E font24">
			{{ dataItem.time }}
		</view>
	</view>
</template>

<script setup lang="ts">
	import{onMounted}from'vue';
	const props = defineProps({
		dataItem: {
			type: Object,
			default: {}
		}
	})
	
	onMounted(()=>{
		const date = new Date(props.dataItem.create_time);
		
		const year = date.getFullYear();
		const month = date.getMonth() + 1; // 注意：月份从0开始，所以需要加1
		const day = date.getDate();
		const hour = date.getHours();
		const minutes = date.getMinutes();
		const seconds = date.getSeconds();
		
		// 格式化成字符串
		const formattedDateTime = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')} ${hour.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
		props.dataItem.time=formattedDateTime
	})
</script>

<style lang="scss" scoped>

	.commission-item {
		padding: 30rpx;
		border-bottom: 2rpx solid #E5E5E5;
	}
</style>
